Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

378
Visualizações
How is __proto__ different from [[Prototype]]?

My understanding on the concept: objects come with a hidden property called __proto__ that provides reference to function object's prototype property. When I create an empty object and log it into the console, I see the property within the object is [[Prototype]] instead of __proto__. Can you provide any insight or correction to my understanding on the concept?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

[[Prototype]] refers to an internal slot of objects - values which are held in the JS engine, but not directly exposed to the running JavaScript. See here for details from the specification.

The value contained in an internal slot can often be retrieved if there are methods that deliberately expose it.

For another example of an internal slot, consider the values of a Set:

const set = new Set();
set.add('someValue');

The someValue is not directly visible on the Set, but it can be accessed through methods which run native code, and that native code accesses the internal slots of the Set to see what it contains - for example, with Set.prototype.has.

In the case of [[Prototype]], the value in that internal slot can be retrieved by invoking the __proto__ getter, which does:

  1. Return ? O.[[GetPrototypeOf]]().

eventually accessing and returning the [[Prototype]] internal slot.

Also, __proto__ is deprecated - you should prefer to use Object.getPrototypeOf and Object.setPrototypeOf.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda